<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>2：用js实现 百钱买百鸡问题，100元买100只鸡，大公鸡5元一只，老母鸡3元一只，小鸡一元三只，
			有多少种买法,以及各种买法的具体买鸡的数量。</title>
		<script type="text/javascript">
			window.onload = function() {
				buy();
			}

			function buy() {
				var x;
				var y;
				var z;
				for (x = 0; x < 20; x++) {
					for (y = 0; y < 34; y++) {
						for (z = 0; z <= 100; z++) {
							if (x + y + z == 100 && 5 * x + 3 * y + z / 3 == 100) {
								console.log("大公鸡=" ,x ,"只，老母鸡=" ,y, "只，小鸡=" ,z,"只")
							}
						}
					}
				}
			}
		</script>
	</head>
	<body>
	</body>
</html>
